package uni.UNIBEE7B8D.view.User.userMessage;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import uni.UNIBEE7B8D.BaseActivity;
import uni.UNIBEE7B8D.R;
import uni.UNIBEE7B8D.view.User.seeting.SeetingActivity;

public class UserMessageActivity extends BaseActivity implements View.OnClickListener {

    @BindView(R.id.seeting)
    ImageView seeting;
    @BindView(R.id.headTitle)
    TextView headTitle;
    private SharedPreferences sharedPreferences;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_message);
        ButterKnife.bind(this);
        seeting.setOnClickListener(this);
        sharedPreferences = getSharedPreferences("kangconfig", Activity.MODE_PRIVATE);
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        if (sharedPreferences.getString("access_token", null) == null) {
            finish();
        }
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.seeting:
                Intent intent = new Intent(getBaseContext(), SeetingActivity.class);
                startActivity(intent);
                break;
        }
    }

    @OnClick(R.id.headTitle)
    public void onViewClicked() {
    }
}
